package com.atguigu.lease.web.admin.service.impl;

import com.atguigu.lease.model.entity.LeaseAgreement;
import com.atguigu.lease.web.admin.mapper.LeaseAgreementMapper;
import com.atguigu.lease.web.admin.service.LeaseAgreementService;
import com.atguigu.lease.web.admin.vo.agreement.AgreementQueryVo;
import com.atguigu.lease.web.admin.vo.agreement.AgreementVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * @author xiongkunYang
 * @description 针对表【lease_agreement(租约信息表)】的数据库操作Service实现
 * @createDate 2025-04-19 22:27:34
 */
@Service
public class LeaseAgreementServiceImpl extends ServiceImpl<LeaseAgreementMapper, LeaseAgreement>
        implements LeaseAgreementService {
    private final LeaseAgreementMapper leaseAgreementMapper;

    public LeaseAgreementServiceImpl(LeaseAgreementMapper leaseAgreementMapper) {
        this.leaseAgreementMapper = leaseAgreementMapper;
    }

    @Override
    public IPage<AgreementVo> agreementInfoPageByQuery(long current, long size, AgreementQueryVo queryVo) {
        Page<AgreementVo> page = new Page<>(current, size);
        return this.leaseAgreementMapper.selectAgreementPageByQuery(page, queryVo);
    }

    @Override
    public AgreementVo getAgreementInfoById(Long id) {
        return this.leaseAgreementMapper.selectAgreementById(id);
    }
}




